<template>
  <a-layout>
    <the-header></the-header>
    <router-view/>
    <a-layout-footer style="text-align: center">
      电子书商城
    </a-layout-footer>
  </a-layout>
</template>

<script lang="ts">
import { UserOutlined, LaptopOutlined, NotificationOutlined } from '@ant-design/icons-vue';
import {defineComponent, onMounted, ref} from 'vue';
import axios from 'axios';
import TheHeader from "@/components/the-header.vue";
import TheFooter from "@/components/the-footer.vue";
export default defineComponent({
  name: 'app',
  components: {
    TheFooter,
    TheHeader,
    UserOutlined,
    LaptopOutlined,
    NotificationOutlined,
  },
  setup() {
    console.log("serup");
    //const ebooks = ref();
    //const ebooks1 = reactive({books:[]})

    onMounted(() => {
      console.log("onMounted")
      axios.get("http://localhost:8081/ebook/list?name=Spring").then(function (response){
      // const data = response.data;
      // ebooks.value = data.content
      // ebooks1.books = data.content
      console.log(response);
    });
    })

    return {
      selectedKeys1: ref<string[]>(['2']),
      selectedKeys2: ref<string[]>(['1']),
      collapsed: ref<boolean>(false),
      openKeys: ref<string[]>(['sub1']),
    };
  },
});
</script>
<style>
#components-layout-demo-top-side-2 .logo {
  float: left;
  width: 120px;
  height: 31px;
  margin: 16px 24px 16px 0;
  background: rgba(255, 255, 255, 0.3);
}

.ant-row-rtl #components-layout-demo-top-side-2 .logo {
  float: right;
  margin: 16px 0 16px 24px;
}

.site-layout-background {
  background: #fff;
}
</style>
